package com.jiyun.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.jiyun.entity.Brand;
import com.jiyun.mapper.BrandMapper;
import com.jiyun.service.IBrandService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 聪哥哥
 * @since 2023-06-06
 */
@Service
public class BrandServiceImpl extends ServiceImpl<BrandMapper, Brand> implements IBrandService {

    @Autowired
    BrandMapper brandMapper;

    @Override
    public Integer selectByName(String brandName) {
        LambdaQueryWrapper<Brand> qw = new LambdaQueryWrapper<>();
        qw.eq(Brand::getName,brandName);
        return brandMapper.selectOne(qw).getId();

    }
}
